<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    async function foo3() {
      // 1.返回一个普通的值
      // -> Promise.resolve(321)
      return 321
    }
    foo3().then(res => console.log(res))

    async function foo4() {
      // 2.返回一个Promise对象
      return new Promise((resolve, reject) => {
        setTimeout(() => {
          resolve(123)
        }, 3000)
      })
    }
    foo4().then(res => console.log(res))

    async function foo5() {
      // 3.返回一个thenable对象
      return {
        then: function (resolve, reject) {
          setTimeout(() => {
            resolve(456)
          }, 3000)
        }
      }
    }
    foo5().then(res => console.log(res))


  </script>
</body>

</html>